package bg.btanev.eightyfour.shared.dto.profile;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import bg.btanev.eightyfour.shared.dto.TagDto;
import bg.btanev.eightyfour.shared.dto.dtobase.DomainDtoEntity;
import bg.btanev.eightyfour.shared.dto.geo.GeoLocationDto;

/**
 *
 * @author B.Tanev
 *
 */
public abstract class ProfileEventDto extends DomainDtoEntity<Long> implements Comparable<ProfileEventDto> {
	/**
	 *
	 */
	private static final long serialVersionUID = -4142407045727100724L;

	private Date date;
	private String title;
	private String description;
	private Set<TagDto> tags = new HashSet<TagDto>();

	private GeoLocationDto geoLocation;

	private ProfileDto<? extends ProfileEventDto> profile;

	public ProfileEventDto() {
		super();
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Set<TagDto> getTags() {
		return tags;
	}

	public void setTags(Set<TagDto> tags) {
		this.tags = tags;
	}

	public GeoLocationDto getGeoLocation() {
		return geoLocation;
	}

	public void setGeoLocation(GeoLocationDto geoLocation) {
		this.geoLocation = geoLocation;
	}

	public ProfileDto<? extends ProfileEventDto> getProfile() {
		return profile;
	}

	public void setProfile(ProfileDto<? extends ProfileEventDto> profile) {
		this.profile = profile;
	}

	@Override
	public int compareTo(ProfileEventDto o) {
		return this.date.compareTo(o.date);
	}

	@Override
	public String toString() {
		return "ProfileEventDto [date=" + date + ", description=" + description + ", geoLocation=" + geoLocation
				+ ", tags=" + tags + ", title=" + title + ", toString()=" + super.toString() + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ProfileEventDto other = (ProfileEventDto) obj;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		return true;
	}
}
